package com.hoan.service;

import android.app.Service;
import android.content.Intent;
import android.os.Binder;
import android.os.IBinder;
import android.os.RemoteException;
import android.util.Log;

import androidx.annotation.Nullable;


public class OrderService extends Service {
    private static final String TAG = "OrderService";

    @Override
    public void onCreate() {
        super.onCreate();
        Log.i(TAG, "@onCreate");
    }

    @Nullable
    @Override
    public IBinder onBind(Intent intent) {
        Log.i(TAG, "@onBind");
        return new MyBinder();
    }

    private static class MyBinder extends IOrderManager.Stub {
        @Override
        public int add(int arg1, int arg2) throws RemoteException {
            return arg1 + arg2;
        }
    };

    @Override
    public void onDestroy() {
        super.onDestroy();
        Log.i(TAG, "onDestroy");
    }
}



